/*
 * hal_delay.h
 *
 *  Created on: Aug 12, 2013
 *      Author: Ken Arok
 *
 *
 * \brief Hardware Abstraction Layer of Low level delay utilities
 *
 * Copyright (c) 2013 PT Hanindo Automation Solutions. All rights reserved.
 *
 */

#include "config_board.h"

#if BOARD_1_0_USED

#ifndef HAL_DELAY_H_
#define HAL_DELAY_H_

#include <sysclk.h>
#include <cycle_counter.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef F_CPU
#define F_CPU sysclk_get_cpu_hz()
#endif

#define hal_delay_init(fcpu_hz)
#define hal_delay_s(delay)      cpu_delay_ms(1000 * delay, F_CPU)
#define hal_delay_ms(delay)     cpu_delay_ms(delay, F_CPU)
#define hal_delay_us(delay)     cpu_delay_us(delay, F_CPU)

#ifdef __cplusplus
}
#endif

#endif /* HAL_DELAY_H_ */

#endif /* BOARD_1_0_USED */
